﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.Issues.HeroRelatedIssueCoolDownData
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.Issues
{
  public class HeroRelatedIssueCoolDownData : IssueCoolDownData
  {
    [SaveableField(1)]
    public readonly Hero RelatedHero;

    internal static void AutoGeneratedStaticCollectObjectsHeroRelatedIssueCoolDownData(
      object o,
      List<object> collectedObjects)
    {
      ((IssueCoolDownData) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected override void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      base.AutoGeneratedInstanceCollectObjects(collectedObjects);
      collectedObjects.Add((object) this.RelatedHero);
    }

    internal static object AutoGeneratedGetMemberValueRelatedHero(object o)
    {
      return (object) ((HeroRelatedIssueCoolDownData) o).RelatedHero;
    }

    public HeroRelatedIssueCoolDownData(Hero hero, CampaignTime expireTime)
      : base(expireTime)
    {
      this.RelatedHero = hero;
    }

    public override bool IsRelatedTo(object obj) => obj is Hero hero && this.RelatedHero == hero;

    public override bool IsValid() => base.IsValid() && this.RelatedHero != null;
  }
}
